package generator.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;

/**
 * 
 * @TableName permissions
 */
@TableName(value ="permissions")
public class Permissions implements Serializable {
    /**
     * role
     */
    private String role;

    /**
     * resource
     */
    private String resource;

    /**
     * action
     */
    private String action;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * role
     */
    public String getRole() {
        return role;
    }

    /**
     * role
     */
    public void setRole(String role) {
        this.role = role;
    }

    /**
     * resource
     */
    public String getResource() {
        return resource;
    }

    /**
     * resource
     */
    public void setResource(String resource) {
        this.resource = resource;
    }

    /**
     * action
     */
    public String getAction() {
        return action;
    }

    /**
     * action
     */
    public void setAction(String action) {
        this.action = action;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Permissions other = (Permissions) that;
        return (this.getRole() == null ? other.getRole() == null : this.getRole().equals(other.getRole()))
            && (this.getResource() == null ? other.getResource() == null : this.getResource().equals(other.getResource()))
            && (this.getAction() == null ? other.getAction() == null : this.getAction().equals(other.getAction()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getRole() == null) ? 0 : getRole().hashCode());
        result = prime * result + ((getResource() == null) ? 0 : getResource().hashCode());
        result = prime * result + ((getAction() == null) ? 0 : getAction().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", role=").append(role);
        sb.append(", resource=").append(resource);
        sb.append(", action=").append(action);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}